<include file="Public:header"/>

<div class="table-tit">综合查询</div>
<link rel="stylesheet" href="__PUBLIC__/Anal/css/bootstrap-datetimepicker.css">
<script src="__PUBLIC__/Anal/js/bootstrap-datetimepicker.js"></script>
<script src="__PUBLIC__/Anal/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>

<form action="{:U('Cash/reportGet')}" method="post">
    <table class="table table-bgfont">
        <tr>
            <td width="10%" style="line-height:30px;">查询日期</td>
            <td>
                <div class="col-sm-2">
                    <input type="text" name="timestart" class="form-control input-sm form_date" data-date-format="yyyy/mm/dd" required/>
                </div>
                <span style="float:left;">_</span>
                <div class="col-sm-2">
                    <input type="text" name="timeend" class="form-control input-sm form_date" data-date-format="yyyy/mm/dd" required/>
                </div>
            </td>
        </tr>
        <tr>
            <td style="line-height:34px;">订单状态</td>
            <td>
                <div class="col-sm-2">
                    <select name="order" class="form-control">
                        <option value="99">所有</option>
                        <option value="0">待付款</option>
                        <option value="1">待发货</option>
                        <option value="2">已发货</option>
                        <option value="3">退货</option>
                        <option value="4">取消</option>
                        <option value="8">已完成</option>
                    </select>
                </div>
            </td>
        </tr>
        <tr>
            <td style="line-height:34px;">推广类型</td>
            <td>
                <div class="col-sm-2">
                    <select name="type" class="form-control">
                        <option value="0">所有</option>
                        <volist name='cat' id='v'>
                            <option value="{$v.sat_para}">{$v.sat_name}</option>
                        </volist>
                    </select>
                </div>
            </td>
        </tr>
        <tr>
            <td style="line-height:30px;">推广人员</td>
            <td>
                <div class="col-sm-2"><input type="text" name="pop" class="form-control input-sm" placeholder="请输入手机号码"></div>
            </td>
        </tr>
        <tr>
            <td style="line-height:30px;">销售代码</td>
            <td>
                <div class="col-sm-2">
                    <select name="code" class="form-control">
                        <option value="0">所有</option>
                    </select>
                </div>
            </td>
        </tr>
        <tr>
            <td style="line-height:30px;"><button class="btn btn-primary" type="submit">查询</button></td>
            <td>
                <div class="col-sm-2">&nbsp;</div>
            </td>
        </tr>
    </table>
</form>


<script>
    $('.form_date').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0
    });
    $("select[name=type]").change(function () {
        var t = $(this).val();
        $.post("{:U('Cash/getSaleCode')}", {code: t}, function (res) {
            if (res == null) {
                $("select[name=code]").html("<option value=0>所有</option>");
            } else {
                var option="<option value=0>所有</option>";
                for (var i = 0; i < res.length; i++) {
                    option += "<option value='" + res[i]['dis_id'] + "'>" + res[i]['dis_isbn'] + "</option>";
                }
                $("select[name=code]").html(option);
            }
        });
    });
</script>
<include file="Public:footer"/>